package com.house.mapper;

import com.house.entity.House;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author asus
 * @since 2021-02-28
 */
@Mapper
public interface HouseMapper {

    List<House> selectHousesByHousePrice(@Param("startPrice") BigDecimal startPrice, @Param("endPrice") BigDecimal endPrice);

    List<House> selectHousesByHouseType(@Param("roomNum")Integer roomNum, @Param("hallNum") Integer hallNum, @Param("maleNum") Integer maleNum, @Param("femaleNum") Integer femaleNum);

    List<House> selectHousesByHousePlace(@Param("housePlace") String housePlace);

    List<House> selectHousesByHouseArea(@Param("minArea") Integer minArea, @Param("maxArea") Integer maxArea);


    Integer insertOneHouse(@Param("house") House house);

    Integer updateOneHouse(@Param("house") House house);

    int deleteOneHouse(@Param("houseId") Integer houseId);

    List<House> selectAllHouse();

    House selectHouseByHouseId(@Param("houseId") Integer houseId);

    Integer updateHousePictures(@Param("houseId") Integer houseId, @Param("housePhotos") String housePhotos);

    List<Integer> selectHasReleaseHouseId(@Param("releaseId") Integer releaseId);

    List<House> selectHouseByReleaseId(@Param("releaseId") Integer releaseId);

    List<House> selectHouseByHouseTypeAndHousePriceAndCentType(@Param("roomNum") Integer roomNum,@Param("rentType") Integer rentType,@Param("startPrice") BigDecimal startPrice,@Param("endPrice") BigDecimal endPrice);
}
